//
//  NetWorkingHandle.h
//  6.1知识点UI22_NSURLSession
//
//  Created by dingcong on 16/6/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>


@protocol NetworkingHandlerDelegate <NSObject>

- (void)didCompleteWithJSONResult:(id)result
                  receiveData:(NSData *)data;

@end

@interface NetWorkingHandle : NSObject

@property(nonatomic, assign)id<NetworkingHandlerDelegate>delegate;


#pragma mark - GET
//GET
 - (void)netWorkingHandlerGetWithURL:(NSString *)string
                           completion:(void(^)(id result, NSData *data, NSURLResponse *response, NSError *error))completion;

//delegate
- (void)netWorkingHandleGetWithURL:(NSString *)string;



#pragma mark - POST

- (void)netWorkingHandlePostURL:(NSString *)string httpBody:(NSString *)body
                     completion:(void(^)(id result, NSData *data, NSURLResponse *response, NSError *error))completion;
//delagete

- (void)netWorkingHandlePostWithURL:(NSString *)string httpBody:(NSString *)body;


@end
